#ifndef BBH_LOGGER_H_
#define BBH_LOGGER_H_
#ifdef __cplusplus
extern "C"
{
#endif

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>

typedef enum {                 
    BBH_LOGGER_LEVEL_DEBUG = 0,
    BBH_LOGGER_LEVEL_INFO,
    BBH_LOGGER_LEVEL_NOTICE,
    BBH_LOGGER_LEVEL_WARN,
    BBH_LOGGER_LEVEL_ERROR,
    BBH_LOGGER_LEVEL_FATAL
} bbh_logger_level;

typedef struct bbh_logger_s bbh_logger_t;

//int  bbh_logger_init();
int  bbh_logger_create(const char*filename, bbh_logger_t**pptr);
int  bbh_logger_configure(bbh_logger_t*_, const char*key, const char*value);
int  bbh_logger_configure_enable(bbh_logger_t*_);
int  bbh_logger_write(bbh_logger_t*_, 
                        const char*filename, size_t filename_len, 
                        const char*function, size_t function_len, 
                        int line, int level, const char*s, size_t len);
int  bbh_logger_vprint(bbh_logger_t*_, 
                        const char*filename, size_t filename_len, 
                        const char*function, size_t function_len, 
                        int line, int level, const char*fmt, va_list args);
int  bbh_logger_print(bbh_logger_t*_, 
                        const char*filename, size_t filename_len, 
                        const char*function, size_t function_len, 
                        int line, int level, const char*fmt, ...);
void bbh_logger_free(bbh_logger_t*_);

#ifdef __cplusplus
}
#endif
#endif
